home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 January / EnterCD 0105.iso / Internet / Norton Internet Security 2005 / NIS_Retail.EXE / Setup / PControl / APP / pcwiz.dll / HTML / WIZ-SUPERVISOR.JS < prev    next >
Encoding:
JavaScript  |  2004-08-31  |  2.4 KB  |  90 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    wiz-Supervisor.js (Javascript file for wiz-Supervisor.HTM)
  6. //
  7. // Copyright (c) by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. var g_OrignalSupervisorName;
  12.  
  13. function OnTabOver()
  14. {
  15.     // Last Control Tab over to the <back, next, close> button.
  16.     var VK_TAB = 9;
  17.     if (window.event.keyCode == VK_TAB)
  18.         window.parent.frames("bottom",0).focus();
  19. }
  20.  
  21. function OnLoad()
  22. {
  23.     // Disable NextButton so user cannot constantly click next.
  24.     window.parent.frames("bottom").NextB.disabled = true;
  25.  
  26.     AcctName.value = parent.UserManager.CurrentUser;
  27.     g_OrignalSupervisorName = parent.UserManager.CurrentUser;
  28.     AcctName.disabled = true;
  29.     Pass.focus();
  30.     
  31.     // Enable NextButton
  32.     window.parent.frames("bottom").NextB.disabled = false;
  33. }
  34.  
  35. function Page_GoNext()
  36. {
  37.     
  38.     try
  39.     { 
  40.         // Disable NextButton so user cannot constantly click next.
  41.         window.parent.frames("bottom").NextB.disabled = true;
  42.         
  43.     // Make sure password and confirmation match
  44.     if (Pass.value != PassB.value)
  45.     {
  46.         alert(StrID("ParentalProductivity_PasswordError"));
  47.             window.parent.frames("bottom").NextB.disabled = false;
  48.         return false;
  49.     }
  50.  
  51.     // If password is empty, pass in empty string
  52.     if(!Pass.value)
  53.     {
  54.         Pass.value = "";
  55.     }
  56.  
  57.     if (!parent.UserManager.SetAdministratorPassword(AcctName.value, Pass.value))
  58.     {
  59.         // Password change failed, most probably the administrator account was deleted
  60.         // so try creating a new account
  61.         parent.UserManager.CreateAccount(AcctName.value, Pass.value, "3");
  62.     }
  63.  
  64.         window.parent.frames("bottom").NextB.disabled = false;
  65.     return true;
  66. }
  67.     catch(err)
  68.     {
  69.         window.parent.frames("bottom").NextB.disabled = false;
  70.     }
  71. }
  72.  
  73. function Page_GoBack()
  74. {
  75.     return true;
  76. }
  77.  
  78. function OnKeyDownHandler()
  79. {
  80.     // Last Control Tab over to the <back, next, close> button.
  81.     var VK_ESCAPE = 27;
  82.  
  83.     if (window.event.keyCode == VK_ESCAPE)
  84.     {
  85.         // Escape key.. We want to exit out of the wizard..
  86.         parent.window.navigate("res://closeme.xyz");
  87.  
  88.     }
  89. }
  90.